const path = require('path')
const { defineConfig } = require('@vue/cli-service')

function resolve(dir) {
  return path.join(__dirname, dir)
}

module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    port: 8080,
    open: true,
    proxy: {
      '/api/': {
        target: 'https://www.baidu.com',
        secure: false,
        changeOrigin: true

      }
    }
  },

  chainWebpack: config => {
    config.resolve.alias.set('@', resolve('src'))
  }
})
